// import axios from "axios";

import axios from "../utils/request.js"

//引入并使用Qs序列化模块
// import Qs from "qs"

let shopManagerId = window.localStorage.getItem("shopAdminId");

export default {
    //获取
    get: value =>
        axios
            .get("/goods", {
                params: { adminId: shopManagerId, shopManagerId, ...value },
            })
            .then(function (response) {
                console.log("API(商品goods,获取返回数据):", response);
                return response;
            }),
    //新增
    post: obj => axios.post("/goods", { adminId: shopManagerId, ...obj }).then((res) => {
        console.log("API(商品goods新增,返回数据):", res);
    }),
    //修改
    put: (id, obj) => axios.put("/goods/" + id, obj),
    //删除
    delete: id => axios.delete("/goods/" + id)
};
